Ext.onReady(function(){
	var chartPanel = new Ext.ux.Chart.Fusion.Panel({
		id:'chartPanel',
		autoScroll:true,
		border:false, 
		chartCfg:{  
			id : 'chart1',  
			params:{
				flashVars:{
					debugMode:0,
					lang:'EN'
				}  
			}
		},
		chartURL:'charts/FCF_MSColumn2D.swf',
		dataURL :'chartData/spiRunDistanceCompareChartData.action' , 
		tbar:['当前年份：',{
			xtype:'combo',
			store:new Ext.data.JsonStore({
						     	fields: ['year', 'value'],
						        data: [{
						            year: '2012',
						            value: 2012
						        },{
						            year: '2013',
						            value: 2013
						        }]
						   }),
			editable :false,
			mode: 'local',
			displayField:'year',
			valueField:'value',
			triggerAction :'all',
            name:"currentYearChoise",
            id:"currentYearChoise",
            value:2013,
            listeners:{
            	select:function(v){
            		chartPanel.setChartDataURL('chartData/spiRunDistanceCompareChartData.action?year='+v.value);
            	}
            }
		},'->',{
			text:'折线图',
			iconCls:'',
			handler:function(){
				chartPanel.setChartUrl('charts/FCF_MSLine.swf');
			}
		},'-',{
			text:'柱状图',
			iconCls:'',
			handler:function(){
				chartPanel.setChartUrl('charts/FCF_MSColumn2D.swf');
			}
		}]  
	});
		
	
	var view = new Ext.Viewport({
		layout:'fit',
		items:[chartPanel]
	});
});